package com.wanxi.util;

import java.util.Scanner;

public class Login {
    public static void main(String[] args) {
        int count = 3;
        String username = "admin";
        String password = "123456";
        Scanner scanner = new Scanner(System.in);
        while (count >= 0) {
            System.out.println("请输入用户名");
            String user = scanner.next();
            System.out.println("请输入密码");
            String pass = scanner.next();
            count--;
            if (user.equals(username) && pass.equals(password)) {
                System.out.println("登录成功，返回到相应页面");
                return;
            } else {
                System.out.println("你还有" + count + "次机会");
            }

        }
        System.out.println("对不起，你的账号被锁定");
    }
}
